package com.yuelife.admin.pojo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.Data;

/**
 * c_comment
 * @author 
 */
@Data
public class Comment implements Serializable {
//    自己的跟帖
    List<Comment> comments;
    /**
     * id
     */
    private Integer id;

    /**
     * 主贴ID,如果status=2,name就是跟帖的id
     */
    private Integer discusion;

    /**
     * 创建人
     */
    private String createdBy;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 图片
     */
    private String img;

    /**
     * 跟帖分类（1.主贴下面的回复，2.跟帖下面的回复）
     */
    private Integer status;

    /**
     * 点赞数
     */
    private Integer likes;

    /**
     * 楼层
     */
    private Integer floor;

    /**
     * 回复的谁
     */
    private String commentTo;

    /**
     * 回复数
     */
    private Integer commentCount;

    /**
     * 回复内容
     */
    private String content;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Comment other = (Comment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDiscusion() == null ? other.getDiscusion() == null : this.getDiscusion().equals(other.getDiscusion()))
            && (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getLikes() == null ? other.getLikes() == null : this.getLikes().equals(other.getLikes()))
            && (this.getFloor() == null ? other.getFloor() == null : this.getFloor().equals(other.getFloor()))
            && (this.getCommentTo() == null ? other.getCommentTo() == null : this.getCommentTo().equals(other.getCommentTo()))
            && (this.getCommentCount() == null ? other.getCommentCount() == null : this.getCommentCount().equals(other.getCommentCount()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDiscusion() == null) ? 0 : getDiscusion().hashCode());
        result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getLikes() == null) ? 0 : getLikes().hashCode());
        result = prime * result + ((getFloor() == null) ? 0 : getFloor().hashCode());
        result = prime * result + ((getCommentTo() == null) ? 0 : getCommentTo().hashCode());
        result = prime * result + ((getCommentCount() == null) ? 0 : getCommentCount().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", discusion=").append(discusion);
        sb.append(", createdBy=").append(createdBy);
        sb.append(", createDate=").append(createDate);
        sb.append(", img=").append(img);
        sb.append(", status=").append(status);
        sb.append(", likes=").append(likes);
        sb.append(", floor=").append(floor);
        sb.append(", commentTo=").append(commentTo);
        sb.append(", commentCount=").append(commentCount);
        sb.append(", content=").append(content);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}